package com.booklove.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.booklove.domain.po.Notes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.booklove.domain.po.Notesjudge;
import com.booklove.domain.vo.NotesVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 笔记 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-09-22
 */
public interface NotesMapper extends BaseMapper<Notes> {

    @Select("select notes.* from notes,notesjudge where note_id=notes.id and notesjudge.result!=#{status}")
    Page<NotesVO> selectPageVO(Page<Notes> page, String name,Integer status);

    @Insert("insert into notesjudge(id, result, advice, note_id, user_id, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)" +
            "values(#{id},#{result},#{advice},#{noteId},#{userId},#{createdBy},#{createdTime},#{updatedBy},#{updatedTime})")
    void saveJudgeNote(Notesjudge notesjudge);
}
